<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>4847：[Neerc2016]Kids Designing Kids</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Neerc2016]Kids Designing Kids</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Neerc2016]Kids Designing Kids</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Neerc2016]Kids Designing Kids                </h1>
                <p>时间限制：50s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div>ls和他的妹子sl都进入了青春期，额头上长出了雀斑。他们分别把雀斑的图案描成了一个矩阵，由&quot;.&quot;和&quot;*&quot;组成，</div>
<div>&quot;.&quot;代表无雀斑，&quot;*&quot;代表有雀斑。他们幻想着未来结婚生子，定义了他们的孩子的额头前的雀斑的生成规则：可以</div>
<div>选择sl的雀斑图案然后进行平行移动，然后他们的儿子的某一个位置有雀斑当且仅当他们中恰好有一人该位置有雀</div>
<div>斑。例如：如果不进行平行移动，则ls的矩阵a[i][j]就对应sl的矩阵b[i][j]，如果将sl的矩阵向右平移x，那么l</div>
<div>s的矩阵a[i+x][j]就对应着sl的矩阵b[i][j]。那么这就可能存在a[i][j]与b[i][j]之间无法对应（因为ls和sl的</div>
<div>矩阵大小不一定相同，也就是可能a[i][j]有字符而b[i][j]没有），于是定义如果某矩阵对应位置没有字符，则与</div>
<div>&quot;.&quot;对应。例如：</div>
<div>ls的矩阵：</div>
<div>.x.x</div>
<div>xx..</div>
<div>..xx</div>
<div>sl的矩阵：</div>
<div>xx.</div>
<div>.xx</div>
<div>x.x</div>
<div>.xx</div>
<div>那么孩子的矩阵：</div>
<div>x..x</div>
<div>x.x.</div>
<div>x..x</div>
<div>.xx.</div>
<div>现给出ls的矩阵，sl的矩阵和孩子的矩阵，问能不能找到一种平行变换方式</div>
<div>使得sl平行变换矩阵后与ls的矩阵生成的儿子的矩阵经过平行变换</div>
<div>（此处的平行变换允许随便移动）后与给出的儿子的矩阵完全重合。</div>
<div></div>
<p></p></p><hr/><h3>输入格式</h3><p><div>第一行两个数n1,m1,表示ls的矩阵的大小。</div>
<div>接下来n1行，每行字符串长m1，表示ls的矩阵。</div>
<div>接下来一行两个数n2,m2,表示sl的矩阵的大小。</div>
<div>接下来n2行，每行字符串长m2，表示sl的矩阵。</div>
<div>接下来一行两个数n3,m3,表示他们的孩子的矩阵的大小。</div>
<div>接下来n3行，每行字符串长m3，表示孩子的矩阵。</div>
<div>1&lt;=n1,m1,n2,m2,n3,m3&lt;=1000。</div>
<div></div>
<p></p></p><hr/><h3>输出格式</h3><p><div>第一行输出一个字符串&quot;YES&quot;或&quot;NO&quot;。</div>
<div>如果第一行输出&quot;YES&quot;，那么第二行再输出两个数x,y，</div>
<div>表示平行变换的方式为向右移x格，向下移y格（x&lt;0则表示向左移-x格，y&lt;0则表示向上移-y格）。</div>
<div></div>
<p></p></p><hr/><h3>样例输入</h3><pre>3 3
..*
.*.
*.*
3 3
**.
..*
.*.
5 2
.*
*.
**
.*
*.</pre><hr/><h3>样例输出</h3><pre>YES
0 2</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=4847" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=4847" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>